home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ Sep 89 / Y0011-Modified MABuild-Sep89 < prev    next >
Encoding:
Text File  |  1989-09-05  |  3.7 KB  |  112 lines  |  [TEXT/GEOL]

  1. Item    8887896                         5-Sept-89        05:27
  2.  
  3. From:   D2769                           Comusearch, James Benson,PRT
  4.  
  5. To:     MID                             France, M.I.D.
  6.  
  7. cc:     MACAPP.TECH$                    MACAPP Tech
  8.  
  9. Sub:    Modified MABuild
  10.  
  11. Fellow MacAppers,
  12.  
  13. In our work here, we needed to keep a demo and a commercial version of our
  14. application.  The -d option in mabuild is perfect for that since it will define
  15. the flag in all the compilers (C, Pascal & Rez).  But we wanted to keep both
  16. versions of the application around so we wouldn't have to recompile the whole
  17. thing each time we switched from one to the other.
  18.  
  19. I added the following two options to MaBuild:
  20.  
  21. -UserVersion VersionName    # Keep objects in folder :.VersionName Files:
  22. -DefineVersion VersionName  # Same as -d VersionName -UserVersion VersionName
  23.  
  24. Only one small problem remains:  You must have a copy of MacApp in a folder
  25. named :.VersionName Files: within the Libraries folder, since it will look for
  26. the same subfolder as it uses for the Application.  You can use the "mabuild
  27. -UserVersion Demo -autobuild" to create it.
  28.  
  29. I put together this message by taking code out of MABuild.p directly, so the
  30. code shown here is correct.  But, I might have left out something, so if
  31. anybody has any problems with these changes, please let me know.  I could
  32. compress the copy of the MABuild.p and link it tomorrow.
  33.  
  34. One more thing:  To compile it: "mabuild -NODEBUG mabuild."  Make sure you use
  35. NoDEBUG.  See note in the TMPWTool.
  36.  
  37. Here are the changes required to the source code of MABuild.
  38.  
  39. Define these constants.
  40.             kwUserVersion        = 86;
  41.             kwDefineVersion        = 87;
  42.  
  43. Add these fields to the TMABuildTool object:
  44.                 fUserVersion:        Boolean;
  45.                 fFolderName:        TStringHandle;
  46.  
  47. Add to the ShowUsage method:
  48.             PutHelp('    -UserVersion VersionName # Keep objects in folder
  49. :.VersionName Files:');
  50.             PutHelp('    -DefineVersion VersionName # Same as -d VersionName
  51. -UserVersion VersionName');
  52.  
  53. This is where the actual work gets done.  Add these to the DoProcessOptionArg
  54. method:
  55.                 kwUserVersion:
  56.                         BEGIN
  57.                             fUserVersion := True;
  58.                             fFolderName.Catenate(GetNextArg);
  59.                             fFolderName.Catenate(' Files');
  60.                         END;
  61.  
  62.                 kwDefineVersion:
  63.                         BEGIN
  64.                             fUserVersion := True;
  65.                             fFolderName.Free;
  66.                             fFolderName := NewTStringHandle;
  67.  
  68.                             theNextArg := GetNextArg;
  69.  
  70.                             fFolderName.Catenate(theNextArg);
  71.                             fFolderName.Catenate(' Files');
  72.  
  73.                             fAsmOptions.Catenate(' -d ');
  74.                             fAsmOptions.Catenate(theNextArg);
  75.  
  76.                             fCOptions.Catenate(' -d ');
  77.                             fCOptions.Catenate(theNextArg);
  78.  
  79.                             fCPlusOptions.Catenate(' -d ');
  80.             fCPlusOptions.Catenate(theNextArg);
  81.  
  82.                             fMakeOptions.Catenate(' -d ');
  83.                             fMakeOptions.Catenate(theNextArg);
  84.  
  85.                             fPascalOptions.Catenate(' -d ');
  86.                             fPascalOptions.Catenate(theNextArg);
  87.                             fPascalOptions.Catenate('=TRUE');
  88.  
  89.                             fRezOptions.Catenate(' -d ');
  90.                             fRezOptions.Catenate(theNextArg);
  91.  
  92.                         END;
  93.  
  94.  
  95. Add to the IMABuildTool method:
  96.             fFolderName := NewTStringHandle;
  97.             fUserVersion := FALSE;
  98.  
  99. Add to the InstallKeywords method:
  100.             InstallKeyWord('UserVersion', kwUserVersion);
  101.             InstallKeyWord('DefineVersion', kwDefineVersion);
  102.  
  103. And, the last IF-THEN in the DoToolAction method should look like this:
  104.             IF fUserVersion Then
  105.                     XSeparateObjectsFolder := fFolderName.AsStr255
  106.             ELSE IF NOT fRenameFlagsPairs.ValueAt(fOptionFlags.AsStr255,
  107. XSeparateObjectsFolder) THEN
  108.                     XSeparateObjectsFolder := fOptionFlags.AsStr255;
  109.  
  110.  
  111.  
  112.